Prolog with Arrays and Bounded Quanti

نویسندگان

  • Jonas Barklund
  • Johan Bevemyr
چکیده

It is proposed to add bounded quantiications to Prolog. The main reason is one of natural expression, many algorithms are expressed more elegantly in a declarative way using bounded quantiications than using existing means, i.e., recursion. In particular this is true for numerical algorithms, an area where Prolog has been virtually unsuccessful so far. Moreover, bounded quantiication has been found to be at least as eecient as recursion, when applicable. We outline an implementation of some bounded quantiications through an extension of Warren's abstract Prolog machine and give performance gures relative to re-cursion. Finally, we have shown elsewhere that bounded quantiication has a high potential for parallel implementation and we conclude in this paper that one can often run the same program eeciently on a sequential computer as well and on several kinds of parallel computers. 2 1 Introduction Barklund and Millroth 6] and Voronkov 25, 26] have proposed bounded quantiications as a computational device for repetition by iteration in logic programs. In this paper we argue for a useful extension of the Prolog programming language with bounded quantiications. Although we propose sequential operational semantics for these constructs here, we have shown elsewhere that many Prolog programs with bounded quantiications can also be run eeciently on parallel computers. We have run programs on both SIMD computers (Connection Machine Model CM-2 by Thinking Machines Corp.) 2] and shared-memory MIMD computers (SUN 630MP and Sequent Symmetry) 3]. Much of the beauty of bounded quantiications lies in the fact that they have a clear declarative semantics, while at the same time they behave well operationally on this wide range of sequential and parallel computers. The rest of the paper is structured as follows. Section 2 introduces syntax and informal semantics for bounded quantiications in Prolog. In Section 3 an extension of Prolog with arrays is proposed and motivated. Section 4 discusses sequential operational semantics for bounded quantiications. The implementation of Warren's abstract Prolog machine in which our experiments have been carried out is brieey described in Section 5. In Section 6 a set of instructions extending Warren's machine is proposed; compilation of bounded universal quantiications to the extended machine instruction set is deened in Section 7. Section 8 contains seven examples of Prolog programs with bounded quantiications and their resulting code, in some cases with corresponding recursive programs for comparison, ended with a list of measured run times. In Section 9 some further …

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Extending Gg Odel for Expressing Restricted Quantiications and Arrays

The expressiveness of the declarative language G odel can be improved by adding to it bounded quanti cations, i.e., quanti cations over nite domains, and arrays. Many problems can be expressed more concisely using bounded quanti cations than using recursion. Arrays are natural for many applications, e.g., in scienti c computing, and are conveniently used in bounded quanti cations. Treating bou...

متن کامل

Semantics of Constraint Logic Programs with Bounded Quantifiers

We survey the areas of Constraint programming, Bounded Quanti ers and Collection Types, then we describe an extension of constraint logic programming by bounded quanti ers. Bounded quanti ers provide the support for nite domain constraint programming in a natural way. We de ne several semantics for constraint logic programs with bounded quanti ers and prove their equivalence. Our results can be...

متن کامل

Combinatorial Search With Picat

Picat, a new member of the logic programming family, follows a different doctrine than Prolog in offering the core logic programming concepts: arrays and maps as built-in data types; implicit pattern matching with explicit unification and explicit non-determinism; functions for deterministic computations; and loops for convenient scripting and modeling purposes. Picat provides facilities for so...

متن کامل

A Variant of Thomason ' s First - order Logic CFBased

In this paper, we de ne a rst-order logic CF 0 with strong negation and bounded classical quanti ers, which is a variant of Thomason's logic CF . For the logic CF 0, the usual Kripke formal semantics is dened based on situations, and a sound and complete axiomatic system is established based on the axiomatic systems of constructive logics with strong negation and Thomason's completeness proof t...

متن کامل

A Systematic Approach to Exploiting Implicit Parallelism in Full Prolog

Prolog is a practical declarative programming language based on Horn Logic. In this paper we argue that implicit parallelism can be extracted from full Prolog. By full Prolog we mean pure Prolog with extra-logical features such as side-eeects, database predicates and cuts. Prolog programs have three main forms of implicit parallelism present in them: or-parallelism, independent and-parallelism ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1993